import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login'
import Home from '../views/Home'
import MyHome from '../views/module/MyHome'
import MonitoringBranch from '../views/module/ MonitoringBranch'
import BuildBasicMsg from '../views/module/BuildBasicMsg'
import EnergyConsumption from '../views/module/EnergyConsumption'
import EnergyWarning from '../views/module/EnergyWarning'
import MonthWarn from "@/components/menu/MonthWarn";
import DayWarn from "@/components/menu/DayWarn";
import ElectricityMonitor from '../views/module/ElectricityMonitor'
import EnergyConsumptionDetial from '../views/module/EnergyConsumptionDetial'
import DataList from '../components/ElectricityMonitor/DataList';
import EnergyAnalysis from "@/views/module/EnergyAnalysis";
import WaterMonitor from "../views/module/WaterMonitor";

import UseEle from '../components/menu/UseEle'
import UseWater from '../components/menu/UseWater'
Vue.use(VueRouter)

const routes = [
    {
        path:'/',
        redirect:'/login'
    },
    {
        path: '/login',
        name: 'Login',
        component: Login,
    },
    {
        path: '/home',
        name: 'Home',
        redirect: '/MyHome',
        component: Home,
        children:[
            {
                path: '/MyHome',
                name: 'MyHome',
                component: MyHome,
                redirect: '/UseEle',
                children: [
                    {
                        path: '/UseEle',
                        name: 'UseEle',
                        component: UseEle
                    },
                    {
                        path: '/UseWater',
                        name: 'UseWater',
                        component: UseWater
                    },

                ]
            },
            {
                path: '/MonitoringBranch',
                name:'MonitoringBranch',
                component: MonitoringBranch,
            },
            {
                path: '/EnergyConsumption',
                name:'EnergyConsumption',
                component: EnergyConsumption,
            },
            {
                path: '/BuildBasicMsg',
                name: 'BuildBasicMsg',
                component: BuildBasicMsg,
            },
            {
                path: '/EnergyWarning',
                name: 'EnergyWarning',
                component: EnergyWarning,
                redirect: '/MonthWarn',
                children: [
                    {
                        path: '/MonthWarn',
                        name: 'MonthWarn',
                        component: MonthWarn,
                    },
                    {
                        path: '/DayWarn',
                        name: 'DayWarn',
                        component: DayWarn,
                    },
                ]
            },
            {
                path: '/ElectricityMonitor',
                name: 'ElectricityMonitor',
                component: ElectricityMonitor,
            },
            {
                path:'/EnergyConsumptionDetial',
                name:'EnergyConsumptionDetial',
                component:EnergyConsumptionDetial
            },
            {
                path: '/EnergyAnalysis',
                name: 'EnergyAnalysis',
                component: EnergyAnalysis
            },
            {
                path: '/WaterMonitor',
                name: 'WaterMonitor',
                component: WaterMonitor

            }
        ]
    },
    {
        path:'/datalist',
        name: 'DataList',
        component: DataList
    }
]

const router = new VueRouter({
  routes
})

export default router
